begintownscript;

variables;
short creature_count = 0;

body;

beginstate 0; //INIT_STATE
	if(get_flag(5,0) != 1) {
		message_dialog("You enter the prosperous town of Relias, and you realize how new this town must be. All of the stone buildings seem unworn, and the trees in and around the town seem very young.","Apparently, the druids have done some great things with this town.");
		set_flag(5,0,1);
		}
	if(get_flag(5,3) != 1) {
		activate_hidden_group(1);
		}
	set_name(6, "Helen");
	set_name(7, "Ian");
	set_name(8, "Delran");
	set_name(26, "Mayor Maler");
	set_name(27, "Alia");
	set_name(28, "Brother Dogwood");
	enable_add_chars(1);
	set_crime_tolerance(2);
break;

beginstate 1; //EXIT_STATE

break;

beginstate 2; //START_STATE

break;

beginstate 10; //Notice the hedge temple
	if(get_flag(5,1) != 1) {
		message_dialog("As you approach the town's center, you notice a very strange sight. A large hedge sits about five feet off the ground, and the hedge itself stands over ten feet tall.","However, soon you see a druid emerge from the hedge, and realize that there must be gaps in it.");
		set_flag(5,1,1);
		}
break;

beginstate 11; //Enter hedge temple
	if(get_flag(5,2) != 1) {
		message_dialog("You carefully step into the hedge, and walk right into what looks like a small temple, except inside a bush. It's not a surprise when you see a druid standing by the water-filled pedestal at the temple's center.","It seems that the druids can grow anything.");
		set_flag(5,2,1);
		}
break;

beginstate 20; //Oakleaf cutscene
	if(get_flag(5,3) != 1) {
		block_entry(1);
		force_view_center(12,35);
		if(char_loc_x(0) == 12) {   
			//Enter weapon shop from north
			set_character_facing(25,0); //Oakleaf faces you
			}
		else {
			//Enter weapon shop from east
			set_character_facing(25,6); //Oakleaf faces you
			}
		force_instant_terrain_redraw();
		text_bubble_on_char(25, "Greetings.");
		force_instant_terrain_redraw();
		pause(15);
		erase_text_bubbles();
		text_bubble_on_char(0, "Greetings.");
		force_instant_terrain_redraw();
		pause(15);
		erase_text_bubbles();
		text_bubble_on_char(25, "Glad you caught up with me.");
		force_instant_terrain_redraw();
		pause(15);
		erase_text_bubbles();
		text_bubble_on_char(25, "Anyway, I'm leaving soon.");
		force_instant_terrain_redraw();
		pause(15);
		erase_text_bubbles();
		text_bubble_on_char(0, "What?");
		force_instant_terrain_redraw();
		pause(15);
		erase_text_bubbles();
		text_bubble_on_char(0, "We just caught up with you!");
		force_instant_terrain_redraw();
		pause(15);
		erase_text_bubbles();
		text_bubble_on_char(25, "I know.");
		force_instant_terrain_redraw();
		pause(15);
		erase_text_bubbles();
		text_bubble_on_char(25, "Sadly, there is little time.");
		force_instant_terrain_redraw();
		pause(15);
		erase_text_bubbles();
		text_bubble_on_char(25, "I must leave for the Sanctum...");
		force_instant_terrain_redraw();
		pause(15);
		erase_text_bubbles();
		set_character_pose(25,2);
		text_bubble_on_char(0, "But wait...");
		force_instant_terrain_redraw();
		pause(10);
		erase_text_bubbles();
		text_bubble_on_char(25, "No time!");
		force_instant_terrain_redraw();
		pause(10);
		erase_text_bubbles();
		put_boom_on_char(25,2,0); //Teleport out
		run_animation_sound(95);
		erase_char(25); //Make Oakleaf disappear
		if(char_ok(3) == 1) {
			text_bubble_on_char(3, "Crud.");
			}
		else {
			text_bubble_on_char(0, "Crud.");
			}
		force_instant_terrain_redraw();
		pause(15);
		erase_text_bubbles();
		pause(10);
		text_bubble_on_char(6, "Showoff.");
		force_instant_terrain_redraw();
		pause(15);
		erase_text_bubbles();
		force_view_center(char_loc_x(0), char_loc_y(0));
		force_instant_terrain_redraw();
		reset_dialog();
	if(get_flag(3,3) != 1) {
		message_dialog("Well, that's just wonderful. As soon as you find the one person who appears to know what's going on, he leaves. Worse yet, you have no idea where the Sanctum is.","");
		}
	else {
		message_dialog("Well, that's just wonderful. As soon as you find the one person who appears to know what's going on, he leaves.","At least you already know where the Sanctum is.");
		}
		toggle_quest(1,0);
		toggle_quest(3,1);
		set_flag(5,3,1);
		}
break;

beginstate 25;
	if(get_flag(5,7) == 0) {
		message_dialog("Strange. The door to this house wasn't locked, but it appears that the owner isn't home.","You begin to wonder if the people in this valley are too trusting for their own good. Or maybe the Order is really as peaceful as they look...");
		set_flag(5,7,1);
		}
break;

